<%@page import="pojo.*,java.util.*"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<%@ page language="java" contentType="text/html; charset=utf-8"
	pageEncoding="utf-8"%>

<div id="ContentPanel">
	<!-- Content -->
	<div id="MainPanel" align="left">

		<div class="ContentPart">
			<h1 class="ContentPartTitle" align="center">TRANG QUẢN LÝ BÌNH
				LUẬN</h1>
		</div>
		<div class="ContentPart">
			<h3 class="ContentPartHeader">Thao tác</h3>
			<div class="ContentPartContent">
				<div id="rightAction" align="right">
					<a href="TrangQuanLyBinhLuan.do?action=LietKeToanBo">
						<div class="actionLargeButton borderThick" align="center">
							<img class="buttonImage"
								src="../Images/Icon/icon_lietKeLarge.png" alt="Liệt kê" />
							<div class="buttonCaption">Liệt kê</div>
						</div>
					</a>
				</div>
				<div id="leftAction">
					<div class="ins">Tìm kiếm sản phẩm:</div>
					<div id="Search">
						<input id="inputTim" class="txtField" type="text" size=auto
							value="Nguyễn Quốc Nhã" /> <a href="#">
							<div id="btSearch">Tìm</div>
						</a>
					</div>
					<hr />
					<div class="ins">Liệt kê Bình luận:</div>
					<div id="Filter">
						&nbsp;&nbsp; <label for="cbbNhomSanPham">Nhóm SP:</label> <select
							name="cbbNhomSanPham" id="cbbNhomSanPham" class="combobox">

							<option name="cbbNhomSanPhamValue" selected="selected">Tất
								cả</option>
							<c:forEach var="sp" items="${sessionScope.nhomSanPham}">
								<a href="#">
									<option name="cbbNhomSanPhamValue">${sp.getTennhom()}</option>
								</a>
							</c:forEach>
						</select> -- <label for="cbbTrangThai">Trạng thái</label> <select
							name="cbbTrangThai" id="cbbTrangThai" class="combobox">
							<option value="tatCa" selected="selected">Tất cả</option>
							<option value="daDuyet">Đã Duyệt</option>
							<option value="chuaDuyet">Chưa Duyệt</option>
						</select> <a href="#">
							<div id="btFilter">Liệt Kê</div>
						</a>
					</div>
				</div>
			</div>
		</div>
		<c:if
			test="${null != requestScope.listBinhLuan && requestScope.listBinhLuan.size() > 0}">
			<div class="ContentPart">
				<h3 class="ContentPartHeader">Danh sách Bình luận</h3>
				<table class="tableQuanLy" border="0" cellpadding="0"
					cellspacing="0">
					<!-- Table -->
					<thead align="center">
						<tr>
							<th>STT</th>
							<th>Mã B.luận</th>
							<th>Người viết</th>
							<th>Sản phẩm</th>
							<th>Ngày viết</th>
							<th>Đánh giá</th>
							<th>T.Thái</th>
							<th>Thao tác</th>
						</tr>
					</thead>
					<tbody>
						<c:forEach var="i" begin="0"
							end="${requestScope.listBinhLuan.size()-1}">
							<c:choose>
								<c:when test="${(i + 1) % 2 == 1 }">
									<tr class="rowLe">
								</c:when>
								<c:otherwise>
									<tr class="rowChan">
								</c:otherwise>
							</c:choose>
							<td width="5%">${i + 1}</td>
							<td width="8%"><a href="#">${requestScope.listBinhLuan[i].getMabinhluan()}</a></td>
							<td width="20%">${requestScope.listBinhLuan[i].getTaikhoan().getHoten()}</td>
							<td><a href="#">${requestScope.listBinhLuan[i].getSanpham().getTensanpham()}</a></td>
							<td width="10%">Chưa thiết kế</td>
							<td width="15%" align="right"><font color="#FF0000">${requestScope.listBinhLuan[i].getDanhgia()
									+ 0} sao </font></td>
							<td width="3%" align="center"><c:choose>
									<c:when
										test="${requestScope.listBinhLuan[i].getDaduyet() == true}">
									Duyệt
								</c:when>
									<c:otherwise>
									Chưa
								</c:otherwise>
								</c:choose></td>
							<td width="15%" align="center"><a
								href="TrangQuanLyBinhLuan.do?action=Xoa&maBinhLuan=${requestScope.listBinhLuan[i].getMabinhluan()}"><img
									src="../Images/Icon/icon_delete.png" alt="Xóa" /></a> <a
								href="TrangQuanLyBinhLuan.do?action=Sua&maBinhLuan=${requestScope.listBinhLuan[i].getMabinhluan()}"><img
									src="../Images/Icon/icon_edit.png" alt="Sửa" /></a> <a
								href="TrangQuanLyBinhLuan.do?action=Duyet&maBinhLuan=${requestScope.listBinhLuan[i].getMabinhluan()}"><img
									src="../Images/Icon/icon_accept.png" alt="Duyệt" /></a></td>
							</tr>
						</c:forEach>
					</tbody>
				</table>
			</div>
		</c:if>
	</div>
	<!-- Content -->
</div>